import request from '@/utils/request'

// 查询项目列表
export function getProjectPage(query) {
  return request({
    url: '/project/page',
    method: 'GET',
	params: query
  })
}

export function getProjectList(query) {
  return request({
    url: '/project/list',
    method: 'GET',
	params: query
  })
}

// 保存房屋
export function addProjectInfo(data) {
  return request({
    url: '/project/create',
    method: 'POST',
	data: data
  })
}

// 查询项目详情
export function getProjectInfo(id) {
  return request({
    url: '/project/get?id=' + id,
    method: 'get'
  })
}

// 修改项目信息
export function updateProjectInfo(data) {
  return request({
    url: '/project/update',
    method: 'PUT',
    data: data
  })
}

// 查询项目人员列表
export function getProjectUserPage(query) {
  return request({
    url: '/project/user/page',
    method: 'GET',
	params: query
  })
}

// 发布项目
export function publishProject(id) {
  return request({
    url: '/busin/project/publish?id=' + id,
    method: 'get'
  })
}

// 注册检定员
export function registerUser(data) {
  return request({
    url: '/project/user/register',
    method: 'POST',
    data: data
  })
}

// 获取所有鉴定员
export function findIdentifyers(query) {
	return request({
	  url: '/project/user/identifyers',
	  method: 'GET',
	  params: query
	})
}

// 添加项目成员
export function addProjectUser(data) {
  return request({
    url: '/project/user/add',
    method: 'POST',
    data: data
  })
}

// 删除用户
export function delProjectUser(projectId, userId) {
  return request({
    url: '/project/user/delete?id=' + userId + '&pid=' + projectId,
    method: 'delete'
  })
}